package vip.source.pattern.part10.facade;

/**
 * 外观类：家庭影院外观
 */
class HomeTheaterFacade {
    private Amplifier amplifier;
    private Projector projector;
    private DVDPlayer dvdPlayer;

    public HomeTheaterFacade(Amplifier amp, Projector projector, DVDPlayer dvd) {
        this.amplifier = amp;
        this.projector = projector;
        this.dvdPlayer = dvd;
    }

    void watchMovie(String movie) {
        System.out.println("Get ready to watch a movie...");
        amplifier.on();
        amplifier.setVolume(5);
        projector.on();
        projector.setInput("DVD");
        dvdPlayer.on();
        dvdPlayer.play(movie);
    }
}
